Trò chơi đua xe động vật trong UNITY Engine
114.938 lượt xem;
- AnimalProperties.cs
- GameScreen /
- AnimalRacing /
- Scripts /
- Assets /
- project /
1 using System;
2 using UnityEngine;
3
4 public class AnimalProperties {
5
6 public readonly float speedX;
7 public readonly float speedY;
8 public readonly float speedXBooster;
9 public readonly float speedYBooster;
10 public readonly float speedXSprings;
11 public readonly float speedYSprings;
12
13 public AnimalProperties(float speedX_decimal, float speedY_decimal)
14 {
15 this.speedX = speedX_decimal / 50;
16 this.speedY = speedY_decimal / 50;
17 this.speedXBooster = speedX + 3;
18 this.speedYBooster = speedY + 1;
19 this.speedXSprings = speedX + 4;
20 this.speedYSprings = speedY + 2;
21 }
22
23 public void printInfo()
24 {
25 Debug.Log("SpeedX=" + speedX + ", speedY=" + speedY + ", SpeedXBooster=" + speedXBooster + ", SpeedYBooster=" + speedYBooster + ", SpeedXSprings=" + speedXSprings + ", SpeedYSprings=" + speedYSprings );
26 }
27
28 }
2 using UnityEngine;
3
4 public class AnimalProperties {
5
6 public readonly float speedX;
7 public readonly float speedY;
8 public readonly float speedXBooster;
9 public readonly float speedYBooster;
10 public readonly float speedXSprings;
11 public readonly float speedYSprings;
12
13 public AnimalProperties(float speedX_decimal, float speedY_decimal)
14 {
15 this.speedX = speedX_decimal / 50;
16 this.speedY = speedY_decimal / 50;
17 this.speedXBooster = speedX + 3;
18 this.speedYBooster = speedY + 1;
19 this.speedXSprings = speedX + 4;
20 this.speedYSprings = speedY + 2;
21 }
22
23 public void printInfo()
24 {
25 Debug.Log("SpeedX=" + speedX + ", speedY=" + speedY + ", SpeedXBooster=" + speedXBooster + ", SpeedYBooster=" + speedYBooster + ", SpeedXSprings=" + speedXSprings + ", SpeedYSprings=" + speedYSprings );
26 }
27
28 }